home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #1 / utv1n1s2.d64 / video phile (.txt) < prev   
Commodore BASIC  |  2022-08-28  |  20KB  |  662 lines

  1. 1 rem video phile v12
  2. 2 rem video tape library database with         indices
  3. 3 rem by michael reich 9/07/86
  4. 4 rem using relative file - use 'create'      program to start rel.file
  5. 5 rem *******************
  6. 10 poke53280,0:poke53281,0:c1$=chr$(5)   :c2$=chr$(152)
  7. 15 uptime=(8*4096)+4
  8. 20 print"[147]"chr$(142)chr$(8)
  9. 25 sp$="                                     ":rem len 37
  10. 30 nf=10:n=100:rem # fields and records-    also see line 20020
  11. 40 dim temp$(nf),kk$(nf),s(nf),l(nf),rc$(4),ia$(n),ib$(n),ic$(n),k$(n)
  12. 50 nr=0: ls$="[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
  13. 52 lp$="*******************"
  14. 55 dim q1$(n),m%(n),s%(20):rem *** used in sort ***
  15. 60 fori=1tonf:readf$(i),s(i),l(i):next
  16. 70 data title,1,20,star,21,20,co-star,41,20
  17. 80 data start,61,4,end,65,4,speed,69,2,time,71,3,year,74,4,type,78,5
  18. 90 data tape #,83,3
  19. 170 gosub 8000: gosub 9800
  20. 175 gosub 200: goto 800
  21. 180 poke781,x:poke782,0:goto195:             rem line select
  22. 185 poke781,21:poke782,0:goto195
  23. 190 poke781,peek(214):poke782,y:             rem tab
  24. 195 poke783,0:sys65520:return
  25. 196 rem *********
  26. 197 rem read index
  27. 198 rem *********
  28. 199 :
  29. 200 gosub470: rem *** init disk ***
  30. 205 nr=0: if mo=4 then print sc$
  31. 210 open 2,8,2,"0:video.index,s,r": i=0
  32. 220 gosub 400: rem *** ck disk error ***
  33. 225 if er=0 then 250
  34. 230 gosub640: rem *** close on no index ***
  35. 235 return
  36. 250 x=17: gosub 180: print"[150]   reading index[157][157][157][157][157][157][157][157][157][157][157][157][157]";
  37. 252 input#2,nr
  38. 255 for i=1 to nr: input#2,ia$(i): next
  39. 260 for i=1 to nr: input#2,ib$(i): next
  40. 270 for i=1 to nr: input#2,ic$(i): next
  41. 340 gosub 460
  42. 350 gosub 370: print"             ": return
  43. 370 in=150
  44. 380 t=ti+in
  45. 385 if ti<t then goto 385
  46. 390 return
  47. 400 :
  48. 402 rem disk utilities
  49. 404 :
  50. 410 er=0:input#15,er,er$
  51. 420 return
  52. 430 close2:ifer>0thenprinter,er$
  53. 440 return
  54. 450 close15:return
  55. 460 gosub430:gosub450:return:               rem close all files
  56. 470 open15,8,15,"i0":return
  57. 500 rem *********
  58. 502 rem write index
  59. 504 rem *********
  60. 510 ifnr<1thenprint"no records in file to save":gosub370:gosub370:goto800
  61. 520 gosub470:rem open command channel
  62. 530 gosub185:print"scratching old index"    :print#15,"s0:video.index"
  63. 560 open2,8,2,"0:video.index,s,w":          gosub400:ifer=0thengoto570
  64. 565 gosub430:gosub450:stop
  65. 570 gosub22300:gosub185:print"writing index":print#2,nr
  66. 580 fori=1tonr:print#2,ia$(i):next:         fori=1tonr:print#2,ib$(i):next
  67. 590 fori=1tonr:print#2,ic$(i):next
  68. 600 gosub460:return
  69. 620 printtab(14)"[145] [150] invalid  [157][157][157][157][157][157][157][157][157][157][157][146]";: gosub 370: return
  70. 630 :
  71. 636 rem *****************
  72. 637 rem close on no index
  73. 638 rem *****************
  74. 639 :
  75. 640 close 2: close 15
  76. 650 em$="no index on disk"
  77. 660 if er<>62 then em$="disk unusable"
  78. 670 x=17: gosub 180
  79. 680 print em$
  80. 690 return
  81. 796 rem *********
  82. 797 rem menu
  83. 798 rem *********
  84. 799 :
  85. 800 x=6: gosub 180
  86. 805 print"[150]>> main  menu [150]<<": print
  87. 810 print "[150]  1[150]- display"
  88. 820 print "[150]  2[150]- edit"
  89. 830 print "[150]  3[150]- add to file"
  90. 840 print "[150]  4[150]- printer"
  91. 845 print "[150]        options"
  92. 850 print "[150]  5[150]- create file": print
  93. 860 print "[150] f8[150]- uptime"
  94. 865 x=21: gosub 180
  95. 870 print "[153]   there are ";nr;"[157][153] records available."
  96. 875 print"                                     "
  97. 880 get k$: if k$="" then 880
  98. 882 if k$=chr$(140) then sys uptime
  99. 884 k=val(k$): if (k<1) or (k>5) then 880
  100. 886 mo=k
  101. 890 on mo gosub 2000,5000,4000,7000,20000
  102. 895 goto800
  103. 935 rem screen displays using                    c-64 graphics chars.
  104. 940 y=21: n$="  rambo  ": r$="[146]": d$="": gosub 8500
  105. 945 for x=1tozz: next
  106. 950 y=23: n$="star wars": r$="": d$="": gosub 8500
  107. 955 for x=1tozz: next
  108. 960 y=25: n$=" top gun ": r$="[146]": d$="": gosub 8500
  109. 970 return
  110. 1000 rem *********
  111. 1002 rem sort indices
  112. 1004 rem *********
  113. 1008 :
  114. 1009 ti$="000000":ifnr<2thenreturn
  115. 1010 rem ia$ array
  116. 1015 ifmo=2thenifp1=0thengoto1100
  117. 1020 forq=1tonr:q1$(q)=ia$(q):next:          so=1:gosub55000
  118. 1030 forq=1tonr:ia$(q)=q1$(q):next
  119. 1100 :
  120. 1110 rem ib$ array
  121. 1115 ifmo=2thenifp2=0thengoto1200
  122. 1120 forq=1tonr:q1$(q)=ib$(q):next:          so=2:gosub55000
  123. 1130 forq=1tonr:ib$(q)=q1$(q):next
  124. 1200 :
  125. 1210 rem ic$ array
  126. 1215 ifmo=2thenifp3=0thengoto1300
  127. 1220 forq=1tonr:q1$(q)=ic$(q):next:          so=1:gosub55000
  128. 1230 forq=1tonr:ic$(q)=q1$(q):next
  129. 1300 return
  130. 1750 :
  131. 1770 gosub1790:printc1$mid$(ti$,4,1);":";right$(ti$,2):return
  132. 1780 gosub1790:printc2$mid$(ti$,4,1);":";right$(ti$,2)c1$:return
  133. 1790 gosub185:print"sorting index...wait   ";:return
  134. 1996 rem *********
  135. 1997 rem display
  136. 1998 rem *********
  137. 1999 :
  138. 2000 if nr<>0 then 2010
  139. 2002 x=21: gosub 180: print"[153]       no records to display! [153]       "
  140. 2004 for x=1to 1750: next
  141. 2006 return
  142. 2010 w=0: print"[147]": gosub 2620: y=11
  143. 2020 print: print "select by: [150]s[146][158]tar": gosub 190: print "[150]m[146][158]ovie title"
  144. 2030 gosub 190: print "[150]t[146][158]ape #": gosub 190: print "[150]r[146][158]ecord #"
  145. 2035 gosub 190: print "[150]q[146][158]uit": print
  146. 2040 x=16:gosub180
  147. 2045 print "[155]          <<- enter choice ->>[146]"
  148. 2050 get s$: if s$="" then 2050
  149. 2054 t$="name                record #"
  150. 2055 if s$="q" then gosub 8000: return
  151. 2060 if s$="s" then print"[147]": gosub 2330: goto 2200
  152. 2070 if s$="m" then print"[147]": gosub 2100: goto 2200
  153. 2080 if s$="t" then print"[147]": gosub 2430: goto 2200
  154. 2082 if s$<>"r" then 2050
  155. 2084 gosub 2700: rem *** get record # ***
  156. 2085 if (s>0) and (s<=nr) then ch=s: goto 2235
  157. 2086 print"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]                ": goto 2050
  158. 2090 x=16: gosub180: print "                [150] invalid  [146]     "
  159. 2095 gosub 370: goto 2040
  160. 2100 t$="title               record #": gosub 2600
  161. 2110 w=1: print"[158]";: for i=1 to nr: print left$(ia$(i),20)" "mid$(ia$(i),21)
  162. 2115 gosub6600:next:poke198,0:return
  163. 2200 printspc(8)"[155]enter rec. # to display"
  164. 2210 print:printspc(12)"[155]or <cr> to exit[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";: k=0: ex=0
  165. 2220 gosub 9500: rem *** get rec # from kbd ***
  166. 2225 if ex=1 then gosub 8000: return
  167. 2230 ch=val(t$)
  168. 2235 gosub 3000
  169. 2240 goto2000
  170. 2330 printsc$:gosub2600
  171. 2340 w=1: print"[158]";: fori=1tonr:printleft$(ib$(i),20)" "mid$(ib$(i),21)
  172. 2345 gosub6600:next:poke198,0:return
  173. 2430 t$="tape #              record #":      printsc$:gosub2600
  174. 2440 w=1: print"[158]";: fori=1tonr:printleft$(ic$(i),l(10));tab(20)mid$(ic$(i),4)
  175. 2450 gosub6600:next:poke198,0:return
  176. 2600 gosub2620:print"[154]"t$
  177. 2610 print"******"tab(20)"*******": print: return
  178. 2620 print "[155]there are "nr"[157][146][155] records in file": print: return
  179. 2700 print "[145][145][145][145][145][145][155]enter record #:";
  180. 2710 gosub 9500: rem *** get kbd input ***
  181. 2720 s=val(t$): return
  182. 3000 rem *********
  183. 3002 rem display record
  184. 3004 rem *********
  185. 3010 printc1$"[147]display record #"ch:         printls$:r1$="":r2$=""
  186. 3020 rc=ch:gosub22000:rc$=r1$+r2$
  187. 3040 x=4: gosub 180
  188. 3042 for z=1 to nf: if z=3 then print
  189. 3045 kk$(z)=mid$(rc$,s(z),l(z)): rem *** temporarily saves fields ***
  190. 3050 print"[153]"f$(z);": [155]";tab(12);kk$(z)
  191. 3060 next: print: if mo<>1 then return
  192. 3070 print: print"[155] press any key to continue "
  193. 3080 poke 198,0: wait 198,1: poke 198,0: return
  194. 3996 rem **********
  195. 3997 rem add record
  196. 3998 rem **********
  197. 3999 :
  198. 4000 print"[147] [159] add record  ": cr=nr+1: rc$="": print
  199. 4020 print "[155] entries for record number"cr":"
  200. 4030 print: print: for i=1 to nf: temp$(i)=""
  201. 4040 if i<>10 then 4046
  202. 4042 print"[155]tape #?  000[157][157][157][150]";
  203. 4044 gosub 9000: if t$="" then temp$(i)="000": goto 4055
  204. 4045 goto 4050
  205. 4046 print"[155]"f$(i)"?"
  206. 4048 print"[145][150]";: gosub 9000: if t$="" then goto 4048
  207. 4050 temp$(i)=left$(t$+sp$,l(i))
  208. 4055 rc$=rc$+temp$(i): next: print
  209. 4060 print"[147]": print"[147] [159] add record  ": print
  210. 4065 gosub 3040: print
  211. 4070 print"            ok?   < y or n >[157][157]